package com.spstudio.iforward.producer;

import javax.ejb.EJB;
import javax.enterprise.inject.Produces;
import javax.naming.NamingException;

import com.spstudio.iforward.end.interfaces.ISPCoreSystemBeanRemote;
import com.spstudio.iforward.qualifier.SPCoreSystemSingleRemoteBean;
import com.spstudio.iforward.system.SPCoreDaemon;

public class SPCoreSystemBeanProducer {
	
	@EJB SPCoreDaemon daemon;
	
	@Produces
	@SPCoreSystemSingleRemoteBean
	ISPCoreSystemBeanRemote produce(){
		ISPCoreSystemBeanRemote bean = null;
 		try {
 			bean = (ISPCoreSystemBeanRemote)daemon.lookup("java:global/iForward-ejb/SPCoreSystemBean");
 		} catch (NamingException e) {
			e.printStackTrace();
		}
 		return bean;
	}
	
}
